//
// Created by jmdvirus on 2020/3/27 下午5:01.
// Copyright (c) 2020 benewtech All rights reserved.
//
//     ******          *             *--*
//       ||            *             |
//       ||  *--*--*---*  * *-********--*
//   *  //   *  *  *   *\ / ||  |  |    |
//    **    *  *  *---* *  *   *--* *--*
//

#ifndef CUTEDEVICE_CMMEDIAOPERATIONOPENCV_H
#define CUTEDEVICE_CMMEDIAOPERATIONOPENCV_H

#include <opencv2/opencv.hpp>

#include "funcs/CMMediaOperationBase.h"

class CMMediaOperationOpenCV : public CMMediaOperationBase
{
public:
    CMMediaOperationOpenCV();
    virtual ~CMMediaOperationOpenCV();

    int readYUV(unsigned char **data) override;

    int readMat(cv::Mat &frame) override;

    int close() override;

    bool isOpened() override;

    int open(int index) override;

private:
    cv::VideoCapture m_cap;
};

#endif  // CUTEDEVICE_CMMEDIAOPERATIONOPENCV_H
